package http

import (
	"blogger/controller"
	"github.com/gin-gonic/gin"
)


// 统一注册路由
func RegisterRoutes(r *gin.RouterGroup) {
	r.GET("/", controller.Index)
	r.GET("/index", controller.Index)
	r.GET("/login", controller.LoginHtml)
	r.POST("/login", controller.Login)
	r.POST("/register", controller.RegisterUser)
	r.GET("/exit", controller.Exit)
	r.POST("/upload", controller.Upload)

	// 文章组
	v1 := r.Group("/article")
	{
		v1.GET("/write", controller.Article)
		v1.POST("/post", controller.AddArticle)
		v1.GET("/articleDetail", controller.ArticleDetail)
	}
}



